//
//  ZZCBankCardController.m
//  ZZC-Finance
//
//  Created by mac on 2017/5/24.
//  Copyright © 2017年 mac. All rights reserved.
//

#import "ZZCBankCardController.h"
#import "ZZCBankCardCell.h"
#import "ZZCAddBankCardController.h"

static NSString *BCCell = @"BCCell";
@interface ZZCBankCardController ()<UITableViewDelegate,UITableViewDataSource>
@property (strong, nonatomic) UITableView *BCTableView;
@end

@implementation ZZCBankCardController


- (void)viewDidLoad {
    [super viewDidLoad];
    self.view.backgroundColor = ZZCBGColor;
    [self.view addSubview:self.BCTableView];
    
}

- (void)viewWillAppear:(BOOL)animated {
    [super viewWillAppear:animated];
    [UIApplication sharedApplication].statusBarStyle = UIStatusBarStyleDefault;
    [self.navigationController setNavigationBarHidden:YES animated:YES];
}


- (void)viewWillDisappear:(BOOL)animated {
    [super viewWillDisappear:animated];
    [self.navigationController setNavigationBarHidden:NO animated:YES];
    [UIApplication sharedApplication].statusBarStyle = UIStatusBarStyleLightContent;
}
//返回
- (IBAction)backClick {
    [self.navigationController popViewControllerAnimated:YES];
    
}
//添加银行卡
- (IBAction)addBankCardClick {
    ZZCAddBankCardController *addBC = [ZZCAddBankCardController new];
    [self.navigationController pushViewController:addBC animated:YES];
}


#pragma mark - 数据源方法

- (NSInteger)tableView:(UITableView *)tableView numberOfRowsInSection:(NSInteger)section {
    return 10;
    
}

- (UITableViewCell *)tableView:(UITableView *)tableView cellForRowAtIndexPath:(NSIndexPath *)indexPath {
    ZZCBankCardCell *cell = [tableView dequeueReusableCellWithIdentifier:BCCell];
    cell.selectionStyle = 0;
    cell.bankNameLabel.text = [NSString stringWithFormat:@"中国银行-%ld",(long)indexPath.row+1];
    return cell;
}


- (void)tableView:(UITableView *)tableView didSelectRowAtIndexPath:(NSIndexPath *)indexPath {
    
}
- (CGFloat)tableView:(UITableView *)tableView heightForRowAtIndexPath:(NSIndexPath *)indexPath {
    return 150;
}

#pragma mark - 懒加载
- (UITableView *)BCTableView {
    if (_BCTableView == nil) {
        _BCTableView = [[UITableView alloc] initWithFrame:CGRectMake(0, 64, ZZCScreenW, ZZCScreenH-79)];
        [_BCTableView registerNib:[UINib nibWithNibName:@"ZZCBankCardCell" bundle:nil] forCellReuseIdentifier:BCCell];
        _BCTableView.delegate = self;
        _BCTableView.dataSource = self;
        _BCTableView.separatorStyle = NO;
        _BCTableView.showsVerticalScrollIndicator = NO;
        _BCTableView.backgroundColor = ZZCBGColor;
        
    }
    return _BCTableView;
}


@end
